home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / examples / tcl / x06.tcl < prev    next >
Encoding:
Text File  |  1994-08-09  |  1.3 KB  |  63 lines

  1. # $Id: x06.tcl,v 1.2 1994/08/09 08:23:26 mjl Exp $
  2. # $Log: x06.tcl,v $
  3. # Revision 1.2  1994/08/09  08:23:26  mjl
  4. # Changed to new tclMatrix notation.
  5. #
  6. # Revision 1.1  1994/06/30  18:49:38  mjl
  7. # Tcl demo programs, which fully reproduce their x??c counterpart.
  8. #
  9. #----------------------------------------------------------------------------
  10. # PLplot Tcl demo #6
  11. #
  12. # After sourcing, just type "6".
  13. #----------------------------------------------------------------------------
  14.  
  15. proc 6 {} {
  16.  
  17.     matrix x f 1
  18.     matrix y f 1
  19.  
  20.     pladv
  21.     plfont 1
  22.  
  23. # Set up viewport and window
  24.  
  25.     plcol 2
  26.     plvpor 0.1 1.0 0.1 0.9
  27.     plwind 0.0 1.0 0.0 1.3
  28.  
  29. # Draw the grid using plbox
  30.  
  31.     plbox "bcgt" 0.1 0 "bcgt" 0.1 0
  32.  
  33. # Write the digits below the frame
  34.  
  35.     plcol 15
  36.     for {set i 0} {$i <= 9} {incr i} {
  37.     plmtex "b" 1.5 [expr 0.1 * $i + 0.05] 0.5 $i
  38.     }
  39.  
  40.     set k 0
  41.     for {set i 0} {$i <= 12} {incr i} {
  42.  
  43. # Write the digits to the left of the frame
  44.  
  45.     plmtex "lv" 1.0 [expr 1.0 - (2 * $i + 1)/26.0] 1.0 [expr 10*$i]
  46.     for {set j 0} {$j <= 9} {incr j} {
  47.         x 0 = [expr 0.1 * $j + 0.05]
  48.         y 0 = [expr 1.25 - 0.1 * $i]
  49.  
  50. # Display the symbols
  51.  
  52.         if {$k < 128} {
  53.         plpoin 1 x y $k
  54.         }
  55.         incr k
  56.     }
  57.     }
  58.  
  59.     plmtex "t" 1.5 0.5 0.5 "PLPLOT Example 6 - PLPOIN symbols"
  60.  
  61.     pleop
  62. }
  63.